package javacafe.action.workshop;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.event.SeminarDTO;
import javacafe.dto.event.WorkshopDTO;
import javacafe.serviceimple.SeminarServiceImple;
import javacafe.serviceimple.WorkshopServiceImple;

public class DeleteWorkshopAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionForward actfoward = new ActionForward();
		WorkshopServiceImple schservice = WorkshopServiceImple.getInstance();
		WorkshopDTO scdto = new WorkshopDTO();
		
		String workshop_no = request.getParameter("workshop_no").trim();
		scdto.setWorkshop_no(Integer.parseInt(workshop_no));
		
		schservice.deleteWorkshop(scdto);

		List<WorkshopDTO> lists = schservice.getAllWorkshop();
		
		request.setAttribute("wLists", lists);
		actfoward.setUrl("listworkshop");
		return actfoward;
	}

}
